package com.lx.test.log.idgenerator;

import cn.lx.sequence.service.IdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lX
 * @version JDK 8
 * @className Tdgenerator (此处以class为例)
 * @date 2024/5/27
 * @description TODO
 */
@RestController
public class IdGeneratorTestController {

    @Resource
    IdGenerator idGenerator;

    @GetMapping("/testIdGenerator")
    public String getOne(@RequestParam String key ){

        return idGenerator.next(key).toString();
    }

    @GetMapping("/testIdGeneratorList")
    public String getList(@RequestParam String key, @RequestParam Integer size ){

        return idGenerator.nextList(key,size).toString();
    }
}
